/*
 * acm1402.c
 *
 *  Created on: 24 Mar 2010
 *      Author: xuxu
 */

#include<stdio.h>
int main()
{
	int num[50];
	int n;
	int i,j;
	int sam,ella;
	while(scanf("%d",&n)&&n)
	{
		for(i=0;i<n;i++)
		{
			scanf("%d",&num[i]);
		}
		sam=num[0];
		ella=num[n-1];
		i=0;
		j=n-1;
		while(i+1<j)
		{
			if(sam<ella)
			{
				i++;
				sam+=num[i];
			}
			else
			{
				j--;
				ella+=num[j];
			}
		}
		if(sam==ella)
			printf("Sam stops at position %d and Ella stops at position %d.\n",i+1,j+1);
		else
			printf("No equal partitioning.\n");
	}
	return 0;
}
